package com.team.service.impl;

import com.team.mapper.UserMapper;
import com.team.service.UserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

@Service
public class UserServiceImpl implements UserService {
    @Autowired
    private UserMapper userMapper;
    @Override
    public String Login(String studentId, String password) {
        String psw = userMapper.getPswById(studentId);

        if(psw==null) return "没有注册该用户";
        else if (!psw.equals(password)) return "密码错误";

        return userMapper.getRoleById(studentId);
    }
}
